package com.hxzy.service.impl;

import com.hxzy.controller.vue.login.req.AdminLoginReq;
import com.hxzy.controller.vue.login.resp.AdminLoginResp;
import com.hxzy.service.EmployeeService;
import com.hxzy.service.MerchandiserService;
import com.hxzy.service.VueLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author wy
 * @Description TODO
 * @Date 2023/8/29 9:42
 * @Version 1.0
 */
@Service
public class VueLoginServiceImpl implements VueLoginService {

    /**
     * 管理员
     */
    @Autowired
    private EmployeeService  employeeService;

    /**
     * 商家
     */
    @Autowired
    private MerchandiserService  merchandiserService;

    @Override
    public AdminLoginResp login(AdminLoginReq req) {
        if(req.getType().equalsIgnoreCase("admin")){
           return employeeService.login(req);
        }else{
            return  merchandiserService.login(req);
        }

    }
}
